package com.cn.xiaonuo.modular.controller.app;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.xiaonuo.core.pojo.response.ResponseData;
import com.cn.xiaonuo.modular.model.app.UserProtocol;
import com.cn.xiaonuo.modular.service.app.UserProtocolService;

@Controller
@RequestMapping("/userProtocol")
public class UserProtocolController {
	@Autowired
    private UserProtocolService userProtocolService;
	    @ResponseBody
	    @PostMapping("/queryUserProtocol")
	    public ResponseData updateUserInfo(UserProtocol userProtocol) {
	    	List<UserProtocol> list=userProtocolService.queryList(userProtocol);
	    	ResponseData r=new ResponseData();
	    	r.setData(list);
	    	r.setSuccess(true);
	        return r;
	     
	    }
	    
	    @ResponseBody
	    @PostMapping("/updateUserProtocol")
	    public ResponseData updateUserProtocol(UserProtocol userProtocol) {
	    	userProtocolService.insertOrUpdateVideoDeploy(userProtocol);
	        return ResponseData.success();
	    }

}
